package com.solarStruggle.actions

import java.awt.event.{InputEvent, KeyEvent}
import javax.swing.{ImageIcon, KeyStroke}
import scala.swing.{Action}
import controls.{GuiState, NewGameScreen}
import domain.{Game}
import util.{ResourceLoader}

/**
 * Action used to increase the zoom level of the main screen.
 */
class NewGameAction(state: GuiState) 
extends Action("New Game") {
  
  enabled = true
  
  toolTip = "Start a new game"

  accelerator = Some(KeyStroke.getKeyStroke(KeyEvent.VK_N, InputEvent.CTRL_DOWN_MASK))
  icon = new ImageIcon(ResourceLoader.getResourceURL("img/actions/new.png"))
  smallIcon = new ImageIcon(ResourceLoader.getResourceURL("img/actions/new-small.png"))
  
  def apply() {
    val newGameScreen = new NewGameScreen(state)
    newGameScreen.pack()
    newGameScreen.setVisible(true)
  }
    
}
